1. Technical Field
The present disclosure relates to an image processing apparatus and an image processing method.
2. Description of Related Art
Numerous image processing methods are currently available for flaw detection and elimination in images. Most general image processing method comprises the following steps: digitizing the original image to form a bit map; binarizing the bit map using threshold parameters and assigning 1's and 0's accordingly, so as to form a binarized image; performing swelling-shrinking operations on the binarized image to filter out spots or fill in gaps therein. In practice, the “1” pixels will be shown as a black pixel and the “0” pixels will be shown as a white pixel.
Referring to FIGS. 5 and 6, in state “A”, a binarized image includes a foreground and a background. The two pixels “1” and “2” make up a gap in the foreground and a pixel “3” is a spot in the background. In order to fill the gap “1” and “2”, a swelling operation is performed by using a 3*3 window applied to each black pixel, thus a first swelled-binarized image is shown in state “B”. After that, a shrinking operation is performed by using the 3*3 window to constrict the swelled-binarized image in state “B”, thus a first shrunk-binarized image is shown in state “C”. Therefore, the gap “1” and “2” is filled by first swelling and second shrinking the binarized image.
Further referring to FIGS. 7 and 8, in state “C”, there is still the spot “3” in the background. Another shrinking operation is also performed to the first shrunk-binarized image in state “C”, thus a second shrunk-binarized image is shown in state “D” in which the spot “3” is filtered out. After that, another swelling operation is also performed to the second shrunk-binarized image, and a second swelled-binarized image is generated.
In practice, the image processing method requires that first data of each pixel and its adjacent 8 pixels is read, and then the data is processed by software to perform the swelling-shrinking operations. However, during one step, i.e. one pulse time, data of only one pixel can be read, thus it will cost much time to accomplish the processing. For example, when a processing procedure including one swelling operation and one shrinking operation is used to process a 1024*768 bits image, at least 1024*768*3*3*2 steps to read data must be performed.
Therefore, an image processing apparatus and an image processing method are needed in the industry to address the aforementioned deficiency.